lib: Add OSTREE_SUPPRESS_SYNCFS environment variable
authorColin Walters <walters@verbum.org>
Thu, 9 Jun 2016 14:49:03 +0000 (10:49 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 9 Jun 2016 21:10:35 +0000 (21:10 +0000)
Just to work around valgrind not understanding the `syncfs()` syscall
in EL7 right now.

Closes: #292
Approved by: krnowak

src/libostree/ostree-repo-commit.c

index 6166c65237dcdb812c546a76ef52d68c3de8e8ab..fc6ffd24937172090daa079c4d800b11e0e5e5b6 100644 (file)
@@ -1469,10 +1469,16 @@ ostree_repo_commit_transaction (OstreeRepo                  *self,
       goto out;
     }
 
-  if (syncfs (self->tmp_dir_fd) < 0)
+  /* FIXME: Added since valgrind in el7 doesn't know about
+   * `syncfs`...we should delete this later.
+   */
+  if (g_getenv ("OSTREE_SUPRESS_SYNCFS") == NULL)
     {
-      glnx_set_error_from_errno (error);
-      goto out;
+      if (syncfs (self->tmp_dir_fd) < 0)
+        {
+          glnx_set_error_from_errno (error);
+          goto out;
+        }
     }
 
   if (!rename_pending_loose_objects (self, cancellable, error))